﻿@model Model.GroupInfo
@{
    ViewBag.Title = "UserShare";
    Layout = "~/Views/Shared/YunMp.cshtml";
}
@section Head{
    <script src="~/Scripts/Yun/MyYunFile.js"></script>
    <script src="~/Application/layer/layer.min.js"></script>
    <script src="~/Scripts/areaSelect.js"></script>
    <script src="~/Scripts/jQuery.asyncLoading.js"></script>
    <script src="~/Scripts/Yun/Department.js"></script>
    <script type="text/javascript">
        $(function () {
            var FileId = $.getQueryStringByName("FileId");//如果是文件夹点进来，需获取文件夹的id
            var GroupId = '@Model.GroupId';
            var UrlLoad = "/UserGroup/UserShareLoad";
            var Url = "/UserGroup/UserShare?GroupId=" + GroupId + "&FileId=";

            var ShowCookieType = getCookie("ShowType");
            if (ShowCookieType == null) {
                setCookie("ShowType", "grid", "d1");
            }

            if (FileId != "") {
                $("#HidFileId").val(FileId);
            }
            //获取文本搜索框的值
            var SearchCookie = getCookie("SearchInfo");
            $("#SearchId").val(SearchCookie);

            DFBGDepartment.FlieShare.Flie.InFileOnlode(FileId, Url);
            //调用方法加载网盘数据
            DFBGDepartment.FlieShare.Flie.MyFileLoad(FileId, SearchCookie, UrlLoad, Url, GroupId);
            //清空cookie
            setCookie("SearchInfo", $("#SearchId").val(), "d-1");

            //判断大图标或列表显示方式
            if (ShowCookieType == "List") {
                $(".list-grid-switch").removeClass("grid-switched-on");
                $(".list-grid-switch").addClass("list-switched-on");
                $("#TypeShow").val("List");
                $(".FileShowList").css({ "display": "block", "height": "100%" });
                $("#FileShow").css({ "display": "none", "height": "auto" });
                $("#FileShow").parent().css({ "height": "auto" });
                $("#FileShowList").parent().css({ "height": "100%" });

            }
            else {
                $(".list-grid-switch").removeClass("list-switched-on");
                $(".list-grid-switch").addClass("grid-switched-on");
                $("#TypeShow").val("Tu");
                $(".FileShowList").css({ "display": "none", "height": "auto" });

                $("#FileShow").css({ "display": "block", "height": "100%" });
                $("#FileShow").parent().css({ "height": "100%" });
                $("#FileShowList").parent().css({ "height": "auto" });
            }
            //更多弹框点任意地方隐藏
            $(document).bind('mousedown', function (event) {
                var $target = $(event.target);
                if (!($target.parents().is('.Baiparent'))) {
                    $(".Baiparent").children("span").hide();
                }
            });

        })
    </script>
}
<body>
    <div class="oh module-toolbar">
        <input type="hidden" id="HidFileId" />@*存放父级文件id*@
        <input type="hidden" id="Share" value="1003" />
        <input type="hidden" id="GroupOrAgencyId" value="@Model.GroupId" />
        <input type="hidden" id="FileId" value="" />
        <div class="Linkshare">
            <span style=" float: left;"> 用户组分享-@Model.GroupName</span>
            <div style="display: inline-block; float: left; margin-left:10px; ">
               @if( ViewBag.Admin ){ <a class="g-button g-button-blue upload-wrapper">
                        <span onclick='DFBG.FlieOA.Flie.showLayer();' class="g-button-right"><em title="上传" class="icon icon-upload"></em><span class="text" style="width: 20px;">上传</span></span>
                    </a><a href="#" onclick="DFBGFlie.Flie.FlieOperation.NewsFile()" class="g-button"><span class="g-button-right"><em title="新建文件夹" class="icon icon-newdir"></em><span class="text" style="width: auto;">新建文件夹</span></span></a>}
                <a href="#" onclick="DFBGFlie.Flie.FlieOperation.DownFileMore()" class="g-button FlieOperation" style="margin: 0px; border-left: 1px solid #bbcbdf;background-position: -10px -144px;"><span class="g-button-right"><em title="下载" class="icon icon-download-gray"></em><span class="text" style="width: auto;">下载</span></span></a>@if( ViewBag.Admin )
                {<a href="#" onclick="DFBGFlie.Flie.FlieOperation.Transfer('', 'parent','No')" class="g-button FlieOperation" style=" margin: 0px; background-position: -10px -144px; border-left:1px solid #bbcbdf; "><span class="g-button-right" style="background-position:-20px -144px;"><em title="删除" class="icon icon-delete"></em><span class="text" style="width: auto;">删除</span></span></a><a href="#" onclick="    DFBGFlie.Flie.FlieOperation.OnReNameFor()" class="g-button FlieOperation Renamed" style="margin: 0px; background-position: -10px -144px; border-left:1px solid #bbcbdf; "><span class="g-button-right" style="background-position:-20px -144px;"><span class="text" style="width: auto;">重命名</span></span></a><a href="#" onclick="    DFBGFlie.Flie.FlieOperation.MoveShow(1)" class="g-button FlieOperation" style="margin: 0px; background-position: -10px -144px; border-left:1px solid #bbcbdf; "><span class="g-button-right" style="background-position:-20px -144px;"><span class="text" style="width: auto;">复制到</span></span></a><a href="#" onclick="    DFBGFlie.Flie.FlieOperation.MoveShow(2)" class="g-button FlieOperation" style="margin: 0px; background-position: -10px -144px; border-left:1px solid #bbcbdf; "><span class="g-button-right"><span class="text" style="width: auto;">移动到</span></span></a>}
            </div>
            <div class="list-grid-switch grid-switched-on" style="margin:0px;">
                <input type="hidden" id="TypeShow" value="Tu" />@*存放显示类型（图标显示/列表显示）*@
                <a onclick="SelShowType('List')" href="#" class="list-switch"></a>
                <a onclick="SelShowType('grid')" href="#" class="grid-switch"></a>
            </div>
            <a href="javascript:void(0);" onclick="SearchFileMethod()" class="g-button" style="display: inline-block; margin-left: 0px; float: right;">
                <span class="g-button-right">
                    搜索
                </span>
            </a><span class="g-button" style="display: inline-block; float:right;  padding-left:0px; margin-right:0px;">
                <span class="g-button-right" style="padding-right:1px;">
                    <input id="SearchId" type="text" style="border:0px; height:21px;width :200px; padding:2px 5px; margin-top:1px;" />
                </span>
            </span>

        </div>
    </div>
    <div style="padding-left: 10px;">
        <div style="height: 30px; line-height: 30px; padding-left: 10px; position: relative;">
            @*<span>全部文件</span>*@
            <span style="float: right; margin-right: 20px;" id="SumUse"></span>
            <span style="float: right; margin-right: 20px;" id="SumNum"></span>
            <ul id="TitleIds" class="historylistmanager-history" style="display:block;"></ul>
        </div>
        <div class="list-view-header FileShowList" style="display: none; width: 100%;">
            <div class="list-header">
                <ul class="list-cols" style="display: block;">
                    <li style="width: 59%;" class="col first-col descend">
                        <div class="col-item check"><input type="checkbox" class="check-icon" onclick="AllCheck()" id="checkAll" /></div>
                        <span class="text">文件名</span><span class="order-icon"></span>
                    </li>
                    <li style="width: 16%;" class="col"><span class="text">大小</span><span class="order-icon"></span></li>
                    <li style="width: 23%;" class="col last-col"><span class="text">上传日期</span><span class="order-icon"></span></li>
                </ul>

            </div>
        </div>
        <div style="display: block;" class="list-view-container" id="list-view-container">
            <div class="module-list-view" style="overflow-x: hidden; overflow-y: auto;">
                @*  列表显示*@
                <div id="FileShowList" class="list-view FileShowList" style="margin-top: 0px; display: none; height: 100%;">

                </div>

            </div>
            @*大图标显示*@
            <div class="module-grid-view" style=" overflow-x: hidden; overflow-y: auto;">
                <div id="FileShow" class="grid-view" style="margin-top: 0px; display: block; height: 100%;">


                </div>
            </div>
        </div>
    </div>
    <div id="popup_overlay"></div>
    <!--弹出层  删除-->
    <div id="popup_container"></div>
    <script type="text/javascript">
        $(function () {
            $('.module-grid-view').areaSelect();
        })
    </script>
</body>